package com.third.entity;

import lombok.Data;

@Data
public class Result {
   private static final String SUCCESS_CODE="200";
   private static final String ERROR_CODE="500";

   private String code;
   private String msg;
   private Object data;

    public Result(String code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public Result(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Result() {
    }

    public static Result success(Object data){
       return new Result(SUCCESS_CODE,"",data);
    }

    public static Result success(){
        return new Result(SUCCESS_CODE,"");
    }

    public static Result error(String msg){
        return new Result(ERROR_CODE,msg);
    }
}
